Learn R Programming

bayesianVARs (version 0.1.6)

[.bayesianVARs_coef: Extract or Replace Parts of a bayesianVARs_coef object

Description

Extract or replace parts of a bayesianVARs_coef object.

Usage

# S3 method for bayesianVARs_coef
[(x, i, j, ...)

Value

An object of type bayesianVARs_coef.

Arguments

x

An object of type bayesianVARs_coef.

i

indices

j

indices

...

further indices

Examples

Run this code
# Access a subset of the usmacro_growth dataset
data <- usmacro_growth[,c("GDPC1", "CPIAUCSL", "FEDFUNDS")]

# Estimate a model
mod <- bvar(data, sv_keep = "all", quiet = TRUE)

# Extract coefficients, which are of class bayesianVARs_coef
phi <- coef(mod)
phi[1,1,1]

Run the code above in your browser using DataLab